'''
@author Aurelien Deharbe

This file is part of Cute-Client.

Cute-Client is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Cute-Client is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with Cute-Client.  If not, see <http://www.gnu.org/licenses/>.
'''

from cuteclient.csclient import CSClient

c = CSClient('localhost', 5000)
s = c.newSession("example02")

quit = s.qs("QPushButton('Quit')")
s.qs(quit + ".resize(75, 30)")
s.qs(quit + ".setFont(QFont('Times', 18, QFont.Bold))")

def quit_clicked(sender):
    sys.exit(0)
s.registerCallback(quit, "clicked", quit_clicked)

s.qs(quit + ".show()")
s.mainloop()
